\documentclass{article}
 
\usepackage[pdftex,active,tightpage]{preview}
\usepackage{tikz}
\usetikzlibrary{snakes}
\usetikzlibrary{arrows}
\makeatletter
 
\begin{document}
\begin{preview}
	%%
	\begin{tikzpicture}[scale=0.35]
	
	%% draw regular grid
	\draw[gray, very thin, step=0.25cm] (0,0) grid (8,8);
	
	% draw background ...
	    \filldraw[fill=green, fill opacity=0.3] (0,0) rectangle +(8,8);
	 
	 		% draw first set of boxes ... red 
	 		\filldraw[fill=red, fill opacity=0.3] (2.25,2.75) rectangle +(1,1);
	 		\filldraw[fill=red, fill opacity=0.3] (2.75,6.25) rectangle +(1,1);
	 		\filldraw[fill=red, fill opacity=0.3] (5.75,2.5) rectangle +(1,1);
	 		\filldraw[fill=red, fill opacity=0.3] (6.25,6.75) rectangle +(1,1);
	 		
	 		
	 		% draw first set of boxes ... red 
	 		\filldraw	[fill=blue, fill opacity=0.3] (1.75,1.5) rectangle +(1,1);
	 		\filldraw	[fill=blue, fill opacity=0.3] (1.5,4.25) rectangle +(1,1);
	 		\filldraw	[fill=blue, fill opacity=0.3] (4.25,0.75) rectangle +(1,1);
	 		\filldraw	[fill=blue, fill opacity=0.3] (4.25,4.5) rectangle +(1,1);
	 		
	 		%% The histogram ,,,
		%% red = 64, blue = 64, green 896, total = 1024
		\filldraw[fill=red, fill opacity=0.3] (0.5,-2) rectangle +(0.6,0.125);
		\filldraw[fill=blue, fill opacity=0.3] (1.5,-2) rectangle +(0.6,0.125);
		\filldraw[fill=green, fill opacity=0.3] (2.5,-2) rectangle +(0.6,1.75);
		
		\draw [->] (0,-2) -- (4,-2);
		\draw [->] (0,-2) -- (0,-0.2);
		
		\node at (6,-1) {$\textsc{H = 0.46}$};
	\end{tikzpicture}%%
\end{preview}
\end{document}